package com.jinsi.service.yrf.iml;
import com.jinsi.constant.YrfConstant;
import com.jinsi.mapper.yrf.DepartmentMapper;
import com.jinsi.pojo.Department;
import com.jinsi.service.yrf.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Service
@Transactional
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;
    @Override
    public List<Department> getAll(String deptName, String admintorName, Date deptCreatdate, String deptState, Integer deptParentId) {

        return departmentMapper.getAll(deptName,admintorName,deptCreatdate,deptState,deptParentId, YrfConstant.DEPT_PARENT);
    }

    @Override
    public void updatedeptState(int deptId, String deptState) {
        departmentMapper.updatedeptState(deptId,deptState);
    }

    @Override
    public void departmentadd(Department department) {
        departmentMapper.departmentadd(department);
    }


    @Override
    public void departmentedit(Department department) {
        departmentMapper.departmentedit(department);
    }

    @Override
    public void departmentdelete(int deptId) {
        departmentMapper.departmentdelete(deptId);
    }
}
